package com.dbq.share;

import android.graphics.Bitmap;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by sunkai on 2017/12/26.
 */

public final class ShareWebPage implements Parcelable {
    public String title;
    public String description;
    public String url;
    public Bitmap thumb;
    public String ShareType;

    public ShareWebPage(String title, String description, String url, Bitmap thumb) {
        this.title = title;
        this.description = description;
        this.url = url;
        this.thumb = thumb;
        this.ShareType =  SocializeMediaConstant.WEBLINK;
    }

    public ShareWebPage(String title, String description, String url, Bitmap thumb, String shareType) {
        this.title = title;
        this.description = description;
        this.url = url;
        this.thumb = thumb;
        this.ShareType = shareType;
    }

    protected ShareWebPage(Parcel in) {
        title = in.readString();
        description = in.readString();
        url = in.readString();
        ShareType = in.readString();
        thumb = in.readParcelable(Bitmap.class.getClassLoader());
    }

    public static final Creator<ShareWebPage> CREATOR = new Creator<ShareWebPage>() {
        @Override
        public ShareWebPage createFromParcel(Parcel in) {
            return new ShareWebPage(in);
        }

        @Override
        public ShareWebPage[] newArray(int size) {
            return new ShareWebPage[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(title);
        dest.writeString(description);
        dest.writeString(url);
        dest.writeString(ShareType);
        dest.writeParcelable(thumb, flags);
    }
}
